﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class bomb2 : MonoBehaviour
{

    public GameObject hamburger;
    public GameObject exit;
    public GameObject bolt;


    public int columns = 8;
    public int rows = 8;

    

    // Start is called before the first frame update
    void Start()
    {

       
        Destroy(gameObject, 3.0f);

    }

  

    // Update is called once per frame
    void Update()
    {
 
    }

    void OnTriggerEnter2D(Collider2D c)
    {
        if (c.tag == "Enemy")
        {
            Destroy(c.gameObject);
            Destroy(gameObject); // 删除子弹
            Instantiate(hamburger, gameObject.transform.position, transform.rotation);//生成汉堡
           
        }

        if (c.tag == "Boss")
        {
            Destroy(c.gameObject);//删除敌人
            //加爆炸动画
            Destroy(gameObject); // 删除子弹
            Instantiate(hamburger, gameObject.transform.position, transform.rotation);//生成汉堡
            Instantiate(exit, new Vector3(columns - 1, rows - 1, 0F), Quaternion.identity);//打到boss后生成EXIT


        }

    }
}

